package cn.edu.ctbu.tydemo1.webapi;

import cn.edu.ctbu.tydemo1.core.RUtil;
import cn.edu.ctbu.tydemo1.domain.Student;
import cn.edu.ctbu.tydemo1.service.impl.StudentimplService;
import cn.edu.ctbu.tydemo1.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/webapi/login")
public class LoginApiController {
    @Autowired
    private StudentimplService studentimplService;

    @GetMapping("/student")
    public R student (String name, String password) throws  Exception{
        Student student=studentimplService.findByNameAndPassword(name,password);
        return RUtil.success(student);
    }
}
